<?php

namespace app\index\controller;

use think\exception\ValidateException;
use app\model\Qrcode;

class LocalpicController extends Base
{

    public function index()
    {

        $pic = input('post.pic');
        $filename = end(explode('/', $pic));
        $content = file_get_contents($pic);
        $save_to = config('filesystem.disks.public.root') . '/' . $filename;
        file_put_contents($save_to, $content);

        return $this->json(['data' => toimg('samos/public/uploads/' . $filename)]);
    }
}
